﻿// owner 蒋家伟

#pragma once
#include "ModelBase_home.h"

namespace jsdk
{
    class MODELBASE_EXPORT UnitTestUtils
    {
    public:
        /// \ brief 组合单元测试错误信息
        /// \ in SrcType 原值类型, ExpectResultType 期望结果类型
        /// \ in prefix 错误信息的前缀
        template<typename SrcType, typename ExpectResultType>
        static std::wstring combineErrorTestMsg(const SrcType& srcValue, const ExpectResultType& exceptResultValue, const std::wstring& prefix = L"")
        {
            return combineMsg(StringUtils::toWString(srcValue), StringUtils::toWString(exceptResultValue), prefix);
        }


        /// \ 输出进度的百分比
        static void showPrecent(uint16_t precent);
#pragma region DBG_WARN宏调用
        /// \ brief 以下两个函数由宏调用，不要直接使用
        static void showAbnormalUnitTest(const std::string & filePath, const std::string & function, const uint32_t rowNumber, const std::wstring & ownerName, const std::wstring & time, const std::wstring & description);
        static void showUnitTest(const std::string & filePath, const std::string & function, const uint32_t rowNumber, const std::wstring & ownerName, const std::wstring & time, const std::wstring & description);
#pragma region DBG_WARN宏调用

    private:
        static std::wstring combineMsg(const std::wstring& srcValue, const std::wstring& exceptResultValue, const std::wstring& prefix);
    };
}